Module wmiutils
[hide private]

Module wmiutils

source code

This module provides a set of tools to access Common Information Model (CIM) classes through Windows Management Instrumentation (WMI).

WMI API can be accessed by various protocols such as * Windows shell -- by using 'wmic' command line tool * WMI protocol -- WMI natively provides remote connection capabilities * PowerShell -- PowerShell 2.0 also provides an access to WMI and remote connection capabilities

This module provides a set of classes which are created on top of Universal Discovery clients and provide unified interface to access CIM. That said, the code which uses this module is totally detached from the underlying protocol.

Classes [hide private]
  Converter
This class is a base abstract class for converters.
  NoopConverter
This is a default converter which does just nothing.
  ByMapConverter
This converter considers value obtained from CIM as a key in the dictionary.
  ByFunctionConverter
This converter allows making conversion by custom function.
  ResultItem
This is a stub class used for result objects.
  ColumnNameBasedComparator
This class is used to sort queried properties names.
  QueryElement
This class represents queried CIM class property
  BaseWmiQueryBuilder
This is a base class for all QueryBuilders.
  WmiQueryBuilder
This class represents QueryBuilder for WMI protocol.
  WmicQueryBuilder
This class forms WMI query to be executed by 'wmic' command line tool
  PowerShelWmilQueryBuilder
PowerShell specific query builder.
  _Agent
Base class for WMI agent
  WmiAgent
Agent wraps WMI agent
  WmicAgent
This class wraps WMI client to provide an interface to run WMI queries.
  WmiPowerShellAgent
  WmiAgentProvider
Provides access to WMI using WMI agent
  WmicProvider
  PowerShellWmiProvider
Provides access to WMI using powershell commands
  AttributeMapping
  OshMapping
  WmiToOshMapper
  WmiAgentException
  ConversionException
  UnmappedValueException
  AttributeMappingException
  Language
Language describes localized system configuration: locale, character sets, code pages etc
  LanguageDiscoverer
Discoverer determines the language of target system via WMI queries.
Functions [hide private]
WmiAgentProvider
getWmiProvider(client)
This method returns Provider to work with WMI.
source code
Variables [hide private]
  NOOP_CONVERTER = NoopConverter()
  LANGUAGES = LANG_ENGLISH, LANG_GERMAN, LANG_SPANISH, LANG_RUSS...
  DEFAULT_LANGUAGE = Language(Locale.ENGLISH, 'eng', ('Cp1252',)...
Function Details [hide private]

getWmiProvider(client)

source code 

This method returns Provider to work with WMI.

Parameters:
  • client - row client. Supported client types: Windows shell, PowerShell, WMI
Returns: WmiAgentProvider
Raises:
  • ValueError - if there is no WMI provider implemented for client

Variables Details [hide private]

LANGUAGES

Value:
LANG_ENGLISH, LANG_GERMAN, LANG_SPANISH, LANG_RUSSIAN, LANG_JAPANESE, \
LANG_FRENCH, LANG_ITALIAN, LANG_PORTUGUESE, LANG_CHINESE, LANG_KOREAN,\
 LANG_DUTCH

DEFAULT_LANGUAGE

Value:
Language(Locale.ENGLISH, 'eng', ('Cp1252',), (1033,), 437)